<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
	<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Minimal and Clean Sign up / Login and Forgot Form by FreeHTML5.co</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="Free HTML5 Template by FreeHTML5.co" />
	<meta name="keywords" content="free html5, free template, free bootstrap, html5, css3, mobile first, responsive" />
	

  

  	<!-- Facebook and Twitter integration -->
	<meta property="og:title" content=""/>
	<meta property="og:image" content=""/>
	<meta property="og:url" content=""/>
	<meta property="og:site_name" content=""/>
	<meta property="og:description" content=""/>
	<meta name="twitter:title" content="" />
	<meta name="twitter:image" content="" />
	<meta name="twitter:url" content="" />
	<meta name="twitter:card" content="" />

	<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
	<link rel="shortcut icon" href="favicon.ico">

	<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,300' rel='stylesheet' type='text/css'>
	
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<link rel="stylesheet" href="css/animate.css">
	<link rel="stylesheet" href="css/style.css">


	<!-- Modernizr JS -->
	<script src="js/modernizr-2.6.2.min.js"></script>
	<!-- FOR IE9 below -->
	<!--[if lt IE 9]>
	<script src="js/respond.min.js"></script>
	<![endif]-->
	<style>
		body{
			width: 1350px;
			height: 100%;
			/* background: url("images/background2.gif") repeat; */
		}
	</style>
	</head>
	<body>

		<div class="container">
			<div class="row">
				<div class="col-md-12 text-center">
					<ul class="menu">
						<li class="active"><a href="index.html">学校教务管理系统</a></li>
						<!-- <li><a href="index2.html">Style 2</a></li>
						<li><a href="index3.html">Style 3</a></li> -->
					</ul>
				</div>
			</div>
            <!-- <div class="copyrights">Collect from <a href="http://www.cssmoban.com/"  title="网站模板">网站模板</a></div> -->
			<div class="row">
				<div class="col-md-4 col-md-offset-4">
					

					<!-- Start Sign In Form -->
					<form action="sign-up.php" method="get" class="fh5co-form animate-box" data-animate-effect="fadeIn">
						<input type="hidden" name="action"  value="add">
						<h2>注册</h2>
						<!-- <div class="form-group">
							<div class="alert alert-success" role="alert">您的信息已保存</div>
						</div> -->
						<div class="form-group">
							<label for="name" class="sr-only">Name</label>
							<input name="names" type="text" class="form-control" id="names" placeholder="用户名" autocomplete="off">
						</div>
						<div class="form-group">
							<label for="email" class="sr-only">Email</label>
							<input name="emails" type="email" class="form-control" id="emails" placeholder="邮箱" autocomplete="off">
							<span id="msg"></span>
						</div>
						<div class="form-group">
							<label for="password" class="sr-only">Password</label>
							<input name="passwords" type="password" class="form-control" id="passwords" placeholder="密码" autocomplete="off">
						</div>
						<div class="form-group">
							<label for="re-password" class="sr-only">Re-type Password</label>
							<input name="passwords2" type="password" class="form-control" id="re-passwords" placeholder="重复密码" autocomplete="off">
						</div>
						<div class="form-group">
							<label for="re-yanzheng" class="sr-only">验证码</label>
							<input name="yanzheng" type="text" class="form-control" id="re-yanzheng" placeholder="验证码" autocomplete="off">
						</div>
						<div class="form-group">
							<select name="question">
								<option value="1">您小学在哪里上？</option>
								<option value="2">您父母的工作单位是？</option>
								<option value="3">您最好的朋友？</option>
							</select>
						</div>
						<div class="form-group">
							<label for="re-answer" class="sr-only">请填写答案：</label>
							<input name="answer" type="text" class="form-control" id="re-answer" placeholder="请填写答案" autocomplete="off">
						</div>
						<div class="form-group">
							<label for="remember"><input type="checkbox" id="remember">记住账号</label>
						</div>
						<div class="form-group">
							<p>已有账号？<a href="index.html">登录</a></p>
						</div>
						<div class="form-group">
							<input style="width: 100%;" type="submit" value="注册" class="btn btn-primary">
						</div>
					</form>
					<!-- END Sign In Form -->

				</div>
			</div>
			<div class="row" style="padding-top: 60px; clear: both;">
				<div class="col-md-12 text-center"><p><small>&copy; All Rights Reserved. More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a></small></p></div>
			</div>
		</div>
	
	<!-- jQuery -->
	<script src="js/jquery.min.js"></script>
	<!-- Bootstrap -->
	<script src="js/bootstrap.min.js"></script>
	<!-- Placeholder -->
	<script src="js/jquery.placeholder.min.js"></script>
	<!-- Waypoints -->
	<script src="js/jquery.waypoints.min.js"></script>
	<!-- Main JS -->
	<script src="js/main.js"></script>

	</body>
</html>
<script>
/* $("input[name=emails]").on("blur",function(){
	$.ajax({
		"url":"index1.php",
		"type":"post",
		"data":{
			"email":$(this).val()
		},
		"dataType":"json",
		"success":function(data){
			if(data.code!="200"){
				console.log("111111");
			}
		}
	})
}) */

$("input[name=emails]").on("blur",function(){
	// console.log("ok");
    var reg=/^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/;
    if ($(this).val() == "") {
    $("#msg").html("请输入邮箱").css({"color":"red","fontSize":"16px"});
    }else if(!reg.test($(this).val())){
    $("#msg").html("邮箱格式不正确").css({"color":"red","fontSize":"16px"});
    }else{ //email失去焦点判断不为空时发送ajax请求;
    $.ajax({
             "url":"sign-up.php",
             "type":"post",
             "data":{
                 "email":$(this).val(),
             },
             "dataType":"json",
             "success":function(data){
                 console.log(data);
                 if (data.code!='200') {
                     $("#msg").html(data.msg).css({"color":"red","fontSize":"16px"});
                 }
             }
         })
    }
})

</script>

